Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: Imaging with QuickDraw

Previous | Chapter Top | Chapter Contents | Next |

Customizing Color QuickDraw Operations

For each shape that QuickDraw can draw, there are procedures that perform these basic graphics operations on the shape: framing, painting, erasing, inverting, and filling. As described in the chapter "QuickDraw Drawing" in this book, those procedures in turn call a low-level drawing routine for the shape. For example, the FrameOval , PaintOval , EraseOval , InvertOval , and FillOval procedures all call the low-level procedure StdOval , which draws the oval.

The grafProcs field of a CGrafPort record determines which low-level routines are called. If that field contains the value of NIL , the standard routines are called. You can set the grafProcs field to point to a record of pointers to your own routines. This record of pointers is defined by a data structure of type CQDProcs . By changing these pointers, you can install your own routines, and either completely override the standard ones or call them after your routines have modified their parameters as necessary.

To assist you in setting up a record, QuickDraw provides the SetStdCProcs procedure. You can use the SetStdCProcs procedure to set all the fields of the CQDProcs record to point to the standard routines. You can then reset the ones with which you are concerned.

SetStdCProcs

You can use the SetStdCProcs procedure to get a CQDProcs record with fields that point to Color QuickDraw's standard low-level routines. You can replace these low-level routines with your own, and then point to your modified CQDProcs record in the grafProcs field of a CGrafPort record to change Color QuickDraw's standard low-level behavior.

PROCEDURE SetStdCProcs (VAR cProcs: CQDProcs);
cProcs
Upon completion, a CQDProcs record with fields that point to Color QuickDraw's standard low-level routines.

DESCRIPTION

In the cProcs parameter, the SetStdCProcs procedure returns a CQDProcs record with fields that point to the standard low-level routines. You can change one or more fields to point to your own routines and then set the color graphics port to use this modified CQDProcs record.

SPECIAL CONSIDERATIONS

When drawing in a color graphics port, your application must always use SetStdCProcs instead of SetStdProcs .

SEE ALSO

The routines you install in the CQDProcs record must have the same calling sequences as the standard basic QuickDraw routines, which are described in the chapter "QuickDraw Drawing" in this book. The SetStdProcs procedure is also described in the chapter "QuickDraw Drawing."

The chapter "Pictures" in this book describes how to replace the low-level routines that read and write pictures.

The data structure of type CQDProcs is described on CQDProcs .


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next